
from flask import Flask, render_template, make_response

app = Flask(__name__)

@app.route("/hello",methods=["port","get"])
def hello():
    return render_template("index.html") #跳转到页面

@app.route("/hi",methods=["get","port"])
def hi():
    return make_response("<h1>你好</h1>",9000) #自定义对象响应,可以指定状态码
    # return make_response(render_template("index.html"))

if __name__ == '__main__':
    app.run()